
const path = require('path')
const fs = require('fs')
const SystemController = {};

// 导入模型
const query = require('../model/query.js');
const { send } = require('process');

SystemController.system = (req,res)=>{
    res.render('system.html')
}

// 编辑0
 SystemController. editSystem  = async (req,res)=>{
    let {val,logPic} = req.body
    const sql = `select * from settings val= ${val} and logPic =${logPic}` 
    const result = await query(sql)
    res.json({
        code:10,
        message:"编辑成功"

    })
    
}

SystemController.systemData = async (req, res) => {
    const sql = 'select * from settings';
    const rows = await query(sql)
    res.json(rows)
}
    

module.exports = SystemController;
